package com.jdbc.crud;

/**
 * @author wzm
 * @create 2023-02-23 11:14
 */

/**
 * 数据库与Java对应关系：
 * 数据库一个表 对应  java必须有一个类  类用于存储数据
 * 数据库中的列    对应 java类中的属性  存储各列的值
 */
public class Student {
    private  Integer id;
    private String name;
    private int age;
    private String address;
    //封装  私有化属性 添加get set


    public Student() {
    }

    public Student(Integer id, String name, int age, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}
